// 定义一个高度的变量
@publicHeigth: 458px;

// 顶部导航
.topNav {
  height: 30px;
  line-height: 30px;
  background: #d9d9d9;
  // 右侧列表区域
  .rigthNav {
    a {
      padding: 0 14px;
      &:hover {
        color: #dd302d;
      }
    }
    li:last-child a {
      padding-right: 0;
    }

    li {
      position: relative;
      z-index: 100;
      a {
        position: relative;
        // 二级导航图标
        .iconfont {
          position: absolute;
          right: -7px;
        }
      }

  
      &:hover .second_menu {
        display: block;
      }
      // 二级导航
      .second_menu {
        position: absolute;
        top: 32px;
        left: 0;
        width: 250px;
        height: 100px;
        background-color: #edecec;
        border-radius: 5px;
        display: none;
      }
    }
  }
}

// 搜索区域
.searchBox {
    // 中间区域
    .middle_box {
        width: 690px;
        height: 132px;
        padding-top: 20px;
        box-sizing: border-box;
        // 搜索框
        .search_input {
           height: 36px;
           border: 1px solid #DD302D;
           position: relative;
           float: left;
           input[type="text"] {
              width: 511px;
              height: 36px;
              padding-left: 10px;
              box-sizing: border-box;
              float: left;
           }
           input[type="button"] {
              height: 36px;
              width: 79px;
              background-color: #DD302D;
              float: left;
           }
           span {
               position: absolute;
               top: 50%;
               right: 30px;
               margin-top: -8px;
               color: #fff;
           }
        }

        // 购物车
        .car {
           width: 90px;
           height: 36px;
           line-height: 36px;
           border: 1px solid #DD302D;
           float: right;
           box-sizing: border-box;
           font-size: 12px;
           color: #DD302D;
           text-align: center;
        }


        //热词搜索
        .hot_words {
            float: left;
            margin-top: 10px;
            font-size: 12px;
            a {
               margin-right: 10px;
            }
        }

        //主体导航
        .main_Nav {
           float: left;
           margin-top: 20px;
           li {
             float: left;
             margin-right: 10px;
           }
        }

    }

    // 右侧区域
    .right_box {
        height: 132px;
        width: 290px;
  
        img {
            width: 100%;
        }
    }
}

// 页面主体区域
.main_body {

   background-color: #f3f3f3;
   padding-bottom: 20px;
  //  第一个广告区域
  .banner {
      padding-top: 16px;
      .pub_banner {
          height: @publicHeigth;

          &:nth-child(1) {
              width: 190px;
              background-color: #fff;

              li {
                  height: 28px;
                  line-height: 28px;
                  padding: 0 16px;

                  &:hover {
                      background-color: #DD302D;

                      a {
                         color: #fff;
                      }
                  }
              }
          }

          &:nth-child(2) {
               width: 590px;

               margin: 0 10px;
          }

          &:nth-child(3) {
               width: 190px;
               a:nth-child(2) {
                  margin: 10px 0;
                  display: block;
               }
          }
          &:nth-child(4) {
               width: 190px;
               background-color: #fff;
               margin-left: 10px;

              //用户信息
              .userInfo {
                  width: 150px;
                  height: 84px;
                  margin: 20px auto;
                  border-bottom: 1px solid #ccc;

                  // 顶部区域
                  .top_msg {
                      img {
                          float: left;
                      }
                      p {
                         float: left;
                         font-size: 12px;
                         margin-left: 10px;
                      }
                  }

                  // 底部区域
                  .bot_show {
                      span {
                          width: 64px;
                          height: 22px;
                          float: left;
                          text-align: center;
                          line-height: 22px;
                          background-color: #DD302D;
                          color: #fff;
                          border-radius: 10px;
                          font-size: 12px;
                          margin-top: 15px;
                          margin-left: 6px;
                      }
                      span:last-child {
                          background-color: #363634;
                          color: #BEB482;
                      }
                  }
              }

              // 御码快报
              .newsList {
                 width: 170px;
                 margin: 0 auto;

                //标题
                .newsTitle {
                    margin-bottom: 10px;
                    h4 {
                        float: left;
                    }
                    a {
                        float: right;
                    }
                }

                // 内容区域
                .content {
                    li {
                        margin-bottom: 4px;
                        p {
                          float: left;
                          width: 120px;
                          word-break: keep-all;
                          // 文字中间出现空白不换行
                          white-space: nowrap;
                          overflow: hidden;
                          text-overflow: ellipsis;
                          margin-left: 6px;
                        }
                        span {
                           width: 44px;
                           height: 22px;
                           float: left;
                           text-align: center;
                           line-height: 22px;
                           background-color: #FFE7E7;
                        }
                    }
                }

              }

              //服务列表区域
              .service {
                  width: 170px;
                  height: 180px;
                  margin: 15px auto 0;

                  li {
                      width: 36px;
                      height: 46px;
                      text-align: center;
                      font-size: 12px;
                      float: left;
                      margin-right: 8px;
                      margin-bottom: 18px;
                      &:nth-child(4n) {
                         margin-right: 0;
                      }
                      &:nth-child(n+9) {
                         margin-bottom: 0;
                      }
                      span:first-child {
                          width: 28px;
                          height: 28px;
                          display: block;
                          background: url(../img/侧边栏图标_默认@1x.png) no-repeat;
                          margin: 0 auto;

                          // 鼠标悬停到第一个span标签中
                          &:hover {
                              background: url(../img/侧边栏图标_hover@1x.png) no-repeat;
                          }
                      }
                      
                      &:nth-child(2) {
                          span:first-child {
                              background-position: -38px  0;
                          }
                      }
                      &:nth-child(3) {
                          span:first-child {
                              background-position: -78px  0;
                          }
                      }
                      &:nth-child(4) {
                          span:first-child {
                              background-position: -116px  0;
                          }
                      }
                      &:nth-child(5) {
                          span:first-child {
                              background-position: -38px  -42px;
                          }
                      }
                      &:nth-child(6) {
                          span:first-child {
                              background-position: -76px  -42px;
                          }
                      }
                      &:nth-child(7) {
                          span:first-child {
                              background-position: -116px  -42px;
                          }
                      }
                      &:nth-child(8) {
                          span:first-child {
                              background-position: right  -85px;
                          }
                      }
                      &:nth-child(9) {
                          span:first-child {
                              background-position: -38px  bottom;
                          }
                      }
                      &:nth-child(10) {
                          span:first-child {
                              background-position: -76px  bottom;
                          }
                      }
                      &:nth-child(11) {
                          span:first-child {
                              background-position: -116px  bottom;
                          }
                      }
                      &:nth-child(12) {
                          span:first-child {
                              background-position: -38px  bottom;
                          }
                      }
                  }
              }
          }
      }
  }

  // 秒杀区域
  .s_kill {
      height: 266px;
      margin: 15px 0;
      background-color: #fff;
      // 左侧
      .leftkill {
          width: 190px;
          height: 266px;
          position: relative;
          h4 {
              position: absolute;
              left: 50%;
              top: 25px;
              margin-left: -52px;
              font-size: 26px;
              color: #fff;
          }
      }
      // 中间
      .middlekill {
          li {
             width: 190px;
             height: 266px;
             background-color: #fff;
             text-align: center;
             float: left;
             margin-left: 10px;
             img {
                margin-top: 20px;
             }

             p {
                width: 160px;
                word-break: keep-all;
                white-space: nowrap;
                text-overflow: ellipsis;
                overflow: hidden;
                margin: 20px auto;
             }

             .lastp {
                 color: #DD302D;
                 font-weight: 700;
             }
          }
      }

      // 右侧
      .rightkill {
         height: 266px;
         width: 190px;
      }
  }

  // 年货节
  .year_goods {
      width: 1270px;
      height: 555px;
      margin: 0 auto;
      background: url(../img/年货推荐_背景@1x.png) no-repeat;
      ul {
         padding: 110px 40px 0;
      }
      li {
          width: 190px;
          height: 210px;
          background: url(../img/年货产品背景框框@1x.png) no-repeat;
          text-align: center;
          float: left;
          margin-right: 10px;
          &:nth-child(6n) {
             margin-right: 0;
          }
          &:nth-child(-n + 6) {
              margin-bottom: 10px;
          }
          img {
             margin-top: 20px;
          }

          p:nth-child(2) {
              width: 190px;
              height: 32px;
              line-height: 32px;
              color: #fff;
              background: url(../img/年货产品_免息横幅@1x.png) no-repeat;
          }
          p:nth-child(3) {
              color: #DD302D;
              font-weight: 700;
              margin-top: 10px;
          }
      }
  }

  // 每日特价
  .day_price {
    //  每日特价对应的容器
    margin: 15px 0;
    .priceBox {
        width: 590px;
        height: 318px;
        background-color: #fff;
        padding: 10px;
        box-sizing: border-box;
        margin-right: 10px;

        &:last-child {
           margin-right: 0;
        }

        // 标题区域
        .title {
           height: 34px;
           line-height: 34px;
           img {
             margin-top: 5px;
           }
           h4 {
             font-size: 24px;
           }
        }
        // 内容区域
        .content {
            // 左侧内容区域
            .left_content {
                width: 180px;
                height: 254px;
                background-color: #F8F8F8;
                margin-top: 10px;

                .content_other {
                    text-align: center;
                    margin-top: 10px;

                    p {
                       margin-top: 10px;

                       &:last-child {
                          color: #CCCCCC;
                          font-size: 12px;
                       }
                    }
                }
            }

            // 右侧内容区域
            .right_content {
               width: 390px;
               height: 254px;
               margin-top: 10px;
               padding-top: 32px;
               box-sizing: border-box;
               .item {
                  width: 190px;
                  height: 90px;
                  float: left;
                  margin-right: 10px;
                  margin-bottom: 20px;
                  &:nth-child(2n) {
                     margin-right: 0;
                  }
                  p {
                     width: 90px;
                     
                  }
                  &:hover {
                     box-shadow: 0 5px 5px rgba(0,0,0,.1), 0 -2px 5px rgba(0,0,0,.2);
                     cursor: pointer;
                  }
               }
            }
        }
    }
  }

  // 全球购
  .global {
    //  标题区域
     .title {
         height: 60px;
         line-height: 60px;
         text-align: center;
         h1 {
             font-size: 28px;
         }
     }

     // 内容区域
     .content {
         //公共容器
         .public_products {
            width: 290px;
            height: 560px;
            float: left;
            margin-right: 10px;

            .products {
                 margin-bottom: 10px;
            }

            &:last-child {
                 margin-right: 0;
            }

            &:nth-child(n+3) {
                 .public_item:nth-child(2) {
                     margin: 10px 0;
                 }
            }

            // 公共小盒子
            .public_item {
                 width: 290px;
                 height: 180px;
                 background-color: #fff;

                 .p_title {
                     margin-left: 10px;
                     margin-bottom: 10px;
                     padding-top: 10px;
                     h4 {
                         font-size: 14px;
                     }
                     span {
                         font-size: 12px;
                         margin-left: 10px;
                         margin-top: 2px;
                     }
                 }

                 .imgsBox {
                     a {
                         width: 130px;
                         height: 130px;
                         display: block;
                         float: left;
                         margin-left: 10px;
                         border: 1px solid #fff;
                         box-sizing: border-box;
                         img {
                             width: 128px;
                             height: 128px;
                         }
                         &:hover {
                             border-color: #DD302D;
                         }
                     }
                 }
            }
         }
     }
  }

  // 为你推荐
  .recommand {
      .main_title{
         text-align: center;
         line-height: 60px;
         h1 {
             font-size: 28px;
         }
      }

      .title_list {
         height: 80px;
         background-color: #fff;
         padding: 0 55px;

         li {
             float: left;
             width: 180px;
             height: 80px;
             padding-top: 22px;
             box-sizing: border-box;
             span {
                 width: 68px;
                 display: block;
                 margin: 0 auto;
                 text-align: center;

                 &:first-child:hover {
                     background-color: red;
                     color: #fff;
                     border-radius: 10px;
                    //  设置鼠标为小手模式
                     cursor: pointer;
                 }
             }
         }
      }

      .content {
         margin-top: 10px;
         li {
             width: 230px;
             height: 322px;
             background-color: #fff;
             text-align: center;
             float: left;
             margin-right: 10px;
             &:nth-child(5n) {
                 margin-right: 0;
             }
             &:nth-child(-n+ 5) {
                 margin-bottom: 10px;
             }
             img {
                 margin-top: 40px;
                 margin-bottom: 20px;
             }
            p {
                 text-align: left;
                 width: 190px;
                 padding: 0 20px;
                 box-sizing: border-box;
                 margin-bottom: 20px;
                 color: #000;
                 font-size: 14px;

                 &:last-child {
                     color: #DD302D;
                 }
            }
         }
      }
  }
}
// 底部区域
.footer {
    padding-bottom: 20px;
    background-color: #483E3E;

    .top_footer {
         p {
             float: left;
             margin-right: 10px;

             &:last-child {
                 margin-right: 0;
             }
         }
    }

    .middle_footer{
        border-bottom: 2px solid #584D4D;
        padding-bottom: 25px;
        dl {
            float: left;
            width: 190px;
            height: 200px;
            margin-right: 10px;
            &:last-child {
                 margin-right: 0;
            }
            dt,dd {
                 color: #fff;
                 margin-top: 10px;
            }
        }
    }

    .link {
        text-align: center;
        padding-top: 20px;
        a {
            padding: 0 15px;
        }
        &+p {
             text-align: center;
             margin-top: 15px;
        }
    }
    
}


// 遮罩登录页面容器
.cover {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,.6);
    z-index: 100;
    display: none;
    // 登录区域
    .login {
         position: absolute;
         left: 50%;
         top: 50%;
         margin-top: -318px;
         margin-left: -504px;
         width: 1008px;
         height: 636px;
         background-color:#DD302D;
         border-radius: 20px;

         ul {
             position: absolute;
             left: 50%;
             top: 60px;
             margin-left: -275px;
             li {
                 float: left;
                 width: 183px;
                 height: 56px;
                 &:nth-child(2) {
                     margin: 0 40px;
                 }
                 img {
                     width: 56px;
                     height: 56px;
                     float: left;
                     margin-right: 10px;
                 }
                 p {
                     line-height: 25px;
                     &:nth-child(2) { 
                         padding-top: 5px;
                     }
                     color: #fff;
                     font-weight: 800;
                 }
             }
         }

        //  表单登录区域
        .form_login {
             width: 100%;
             height: 476px;
             background-color: #fff;
             border-radius: 20px;
             margin-top: 160px;
             position: relative;
        }

        // 关闭按钮
        .close {
             position: absolute;
             right: -45px;
             top: -40px;
             width: 40px;
             height: 40px;
             border: 2px solid #fff;
             border-radius: 50%;
             display: block;
             text-align: center;
             line-height: 40px;
             color: #fff;
             font-weight: 800;
        }
    }

    // 左侧区域
    .left_login {
         width: 300px;
         height: 300px;
         margin-left: 104px;
         margin-top: 100px;
         text-align: center;
         padding-top: 20px;
         box-sizing: border-box;

         p:nth-child(2) {
             margin: 20px 0;
         }
         h4 {
             font-size: 28px;
         }
    }

    // 竖线
    .line {
        position: absolute;
        left: 50%;
        top: 50%;
        margin-left: -2px;
        margin-top: -125px;
        width: 4px;
        height: 250px;
        background-color: rgb(233, 226, 227);
    }

    // 右侧区域
    .right_login {
        width: 350px;
        height: 300px;
        margin-right: 70px;
        margin-top: 115px;

        .title {
            a {
                 width: 50%;
                 height: 40px;
                 display: block;
                 float: left;
                 text-align: center;
                 line-height: 40px;
                 font-size: 20px;
                 font-weight: 800;

                 &:hover {
                     color: #DD302D;
                 }
            }
        }

        .public {
            width: 100%;
            height: 44px;
            background-color: #F7F8FC;
            margin-top: 15px;
            border-radius: 10px;
            padding-left: 10px;
            box-sizing: border-box;

            // 当前标签获取到鼠标焦点的时候会执行该选择器,该选择器一般都是和输入框配合使用
            &:focus {
                background-color: pink;
            }
        }
    }
}

// 当该标签被锚点连接指向的时候那么执行对应的选择器
.cover:target {
     display: block;
}
